package miaofusdk

type JdPayOrder struct {
	RequestTradeNo    string `json:"request_trade_no"`
	DownTradeNo       string `json:"down_trade_no"`
	OrderNo           string `json:"order_no"`
	PayAmount         int    `json:"pay_amount"`
	MerchantId        string `json:"merchant_id"`
	Attach            string `json:"attatch"`
	CreateTime        string `json:"create_time"`
	PayTime           string `json:"pay_time"`
	BankType          string `json:"bank_type"`
	PayChannelOrderNo string `json:"pay_channel_order_no"`
	SubAppId          string `json:"sub_app_id"`
	ChnCoupon         int    `json:"chn_coupon"`
	BuyerUserName     string `json:"buyer_user_name"`
	BuyerUserId       string `json:"buyer_user_id"`
	ActualPayAmount   int    `json:"actual_pay_amount"`
	ReceiptAmount     int    `json:"receipt_amount"`
	InvoiceAmount     int    `json:"invoice_amount"`
	PrePayId          string `json:"pre_pay_id"`
	PayInfo           string `json:"pay_info"`
	PayResult         string `json:"pay_result"`
	TradeType         string `json:"trade_type"`
	Subject           string `json:"subject"`
	GoodsDetail       string `json:"goods_detail"`
	GoodsTag          string `json:"goods_tag"`
	TerminalCode      string `json:"terminal_code"`
	OperId            string `json:"oper_id"`
	OrgCode           string `json:"org_code"`
	ShopCode          string `json:"shop_code"`
	StoreCode         string `json:"store_code"`
	BarCode           string `json:"bar_code"`
	StoreName         string `json:"store_name"`
	TradeChannel      string `json:"trade_channel"`
	CodeUrl           string `json:"code_url"`
	CancelTime        string `json:"cancel_time"`
	FrontUrl          string `json:"front_url"`
	BackNotifyUrl     string `json:"back_notify_url"`
	OpenId            string `json:"open_id"`
	SubOpenId         string `json:"sub_open_id"`
}

type JdPayRefundOrder struct {
	RequestTradeNo       string `json:"request_trade_no"`
	MerchantOrderNo      string `json:"merchant_order_no"`
	RefundTradeNo        string `json:"refund_trade_no"`
	RefundDownTradeNo    string `json:"refund_down_trade_no"`
	TotalAmount          int    `json:"total_amount"`
	RefundAmount         int    `json:"refund_amount"`
	TerminalCode         string `json:"terminal_code"`
	ChannelRefundTradeNo string `json:"channel_refund_trade_no"`
	TimeEnd              string `json:"time_end"`
	RefundTime           string `json:"refund_time"`
	TradeType            string `json:"trade_type"`
	MerchantId           string `json:"merchant_id"`
	StoreCode            string `json:"store_code"`
	ShopCode             string `json:"shop_code"`
	OrgCode              string `json:"org_code"`
	StoreName            string `json:"store_name"`
	TradeChannel         string `json:"trade_channel"`
	TradeStatus          string `json:"trade_status"`
	RefundResult         string `json:"refund_result"`
	RefundOperId         string `json:"refund_oper_id"`
	RefundReason         string `json:"refund_reason"`
	RefundTerminalCode   string `json:"refund_termianl_code"`
	BatchNo              int    `json:"batch_no"`
}

type RespJdPayOrderDetail struct {
	//订单数据
	Order JdPayOrder `json:"order,omitempty"`
	//这笔订单下包含的所有退款成功和撤单成功的记录
	RefundOrder []JdPayRefundOrder `json:"refund_order,omitempty"`
}

type RespJdPayOrder struct {
	Code string               `json:"code"`
	Msg  string               `json:"msg"`
	Sign string               `json:"sign"`
	Data RespJdPayOrderDetail `json:"data,omitempty"`
}

/**
订单详情..
交易成功的直接返回.
非成功的.主动确认一次
*/
